package org.caowei.samples.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "exam_user_role")
public class ExamUserRole implements Serializable {

	private static final long serialVersionUID = 3917607168031754410L;
	
	
	
	@Column(name = "role_id", nullable = false)
	private Integer roleId;
	
	@Id
	@Column(name = "user_id", nullable = false)
	private String userId;
	
	@ManyToOne(cascade = {CascadeType.DETACH,CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name = "role_id",insertable=false,updatable=false)
	private ExamRole ExamRole1;
	
	@ManyToOne(cascade = {CascadeType.DETACH,CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name = "user_id",insertable=false,updatable=false)
	private User User3;

	public ExamUserRole() {
		super();
	}
	
	

	public ExamUserRole(Integer roleId, String userId) {
		super();
		this.roleId = roleId;
		this.userId = userId;
	}



	public Integer getRoleId() {
		return roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

}
